home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / demos / commercial / rexxvar_demo.lzh / RexxVar_Demo / install.rexxvar < prev    next >
Encoding:
Text File  |  1994-03-02  |  6.1 KB  |  229 lines

  1. ; Copyright 1994 AugmenTek
  2.  
  3. (complete 0)
  4.  
  5. (transcript "On installing RexxVar Demo, v1.01D")
  6.  
  7. (set @default-dest "Work:")
  8.  
  9. (set centered_title "                      RexxVar Demo")
  10.  
  11. (set assign_name "RXVD"
  12.      @@default-dest (cat assign_name ":"))
  13.  
  14.  
  15. (if (NOT (exists @@default-dest (noreq)))
  16.    (
  17.      (set @@default-dest "Work:")
  18.      (set default_exists 0)
  19.    )
  20.    (
  21.     (set default_exists 1)
  22.     ; Get the value so that later Assign works properly.  The Assign
  23.     ; is done since the startup command will overwrite the old stuff.
  24.  
  25.     (set install_dest (expandpath @@default-dest))
  26.    )
  27. )
  28.  
  29. (welcome (cat centered_title "\n"))
  30.  
  31. (if (= default_exists 0)
  32.   (
  33.    (set install_dest 
  34.       (askdir  
  35.          (prompt 
  36.             (cat "Select where you want to " 
  37.                  "install the " assign_name " directory:\n"
  38.                  "(Do not use REXXVAR: as an assign name)"
  39.             )
  40.          )
  41.          (default @@default-dest)
  42.          (help "Choose a destination volume name or directory " 
  43.                "in which to place the installation files. "
  44.                (cat "A directory called '" assign_name "' ")
  45.                "will be created in the location you choose and"
  46.                "the installation files will be copied to it."
  47.          )
  48.       )
  49.    )
  50.  
  51.    (set install_dest (tackon install_dest assign_name))
  52.    (makedir install_dest (safe) (infos))
  53.   )
  54. )
  55.  
  56. (message "The destination for files is " install_dest)
  57.  
  58. (set parts
  59.    (askoptions 
  60.       (prompt "Choose the items you would like installed:")
  61.       (choices
  62.                "Programs"
  63.       )
  64.       (help "You can install all or part of the RexxVar facility. "
  65.             "If you do not install all parts, you will not be able to use "
  66.             "certain features.  You can choose to install those parts later "
  67.             "by rerunning this install program and selecting the new "
  68.             "parts at this point.\n\n"
  69.             "Here is a brief description of the parts:\n\n"
  70.  
  71.             "- Programs -\nall of the executable files required for\n"
  72.                       "using the REXXVAR or REXXVAR_RC function hosts\n\n"
  73.  
  74.        )
  75.     )
  76. )
  77.                      
  78. (complete 5)
  79.  
  80. ; Programs
  81.  
  82. (if (IN parts 0)
  83.   (
  84.     (set error 
  85.        (trap 1 4
  86.           (copyfiles
  87.               (source "Programs") 
  88.               (dest install_dest) (all)
  89.           )
  90.        )
  91.     )
  92.     
  93.     (if (= error 1) (abort "Aborting..."))
  94.     (if (= error 4) (message ("Copy error %ld" @ioerr)))
  95.  
  96.     (set error 
  97.        (trap 1 4
  98.           (copyfiles
  99.               (source "ReadMe") (dest install_dest)
  100.           )
  101.        )
  102.     )
  103.     
  104.     (if (= error 4) (message ("Copy error %ld" @ioerr)))
  105.     (if (= error 1) (abort "Aborting..."))
  106.  
  107.   )
  108. )
  109.  
  110. (complete 75)
  111.  
  112. ; Assigns
  113.  
  114. (if (IN parts 0)
  115.    (
  116. ;   Create the mount list
  117.  
  118.     (makedir (tackon install_dest "devs") (safe))
  119.  
  120.     (set devs_name (tackon install_dest "devs/mountlist.arexxvar"))
  121.  
  122.     (delete devs_name)
  123.  
  124.     (textfile (dest devs_name)
  125.          (append "AREXXVAR:  Stacksize  = 5000\n"
  126.                  "           Priority   = 5\n"
  127.                  "           GlobVec    = -1\n"
  128.                  (cat
  129.                  "           Handler = " 
  130.                     (tackon install_dest "c/rexxvar-handler"))
  131.                  "\n#"
  132.          )
  133.     )
  134.  
  135.     (complete 80)
  136.  
  137. ;   Create the strings used either now or at startup (usually).
  138.  
  139.     (set startup_assign_string ("Assign s: %s ADD" (tackon install_dest "s")))
  140.     (run startup_assign_string)
  141.  
  142.     (set assign_string ("Assign %s: %s" assign_name install_dest))
  143.     (run assign_string)
  144.  
  145.     (set mount_string
  146.          ("mount AREXXVAR: from %s" devs_name))
  147.     (set run_string 
  148.          (cat "run >NIL: "
  149.               (tackon install_dest "c/rexxvar_server")
  150.               " >CON:460/20/200/22/RexxVar_Server/auto/simple"))
  151.     (set env_string
  152.          (cat "setenv REXXVAR_PATH " (tackon install_dest "c")))
  153.      
  154.     (set startup_name (tackon install_dest "s/rexxvar_startup"))
  155.  
  156.     (textfile (dest startup_name)
  157.          (append (cat 
  158.                      "Failat 50\n" 
  159.                      "Assign AREXXVAR: dismount\n" 
  160.                      "Failat 10\n" 
  161.                      env_string "\n" 
  162.                      mount_string "\n" 
  163.                      run_string
  164.                  )
  165.          )
  166.     )
  167.  
  168.     (protect startup_name "+s")
  169.  
  170.     (set execute_string ("EXECUTE %s" startup_name))
  171.  
  172. ;   Let the user decide when to make it operational.
  173.  
  174.     (set make_operational
  175.           (askchoice
  176.               (prompt "Do you want to make RexxVar operational now?"
  177.               )
  178.               (choices "Yes" "No")
  179.               (default 0)
  180.               (help "By making RexxVar operational now, you can immediately "
  181.                     "start using it.  The alternative is either to put it "
  182.                     "in your startup or to start it up manually, both at a later "
  183.                     "time."
  184.               )
  185.           )
  186.     )
  187.  
  188. ;   If the decision was to make it operational, make it so
  189.  
  190.     (if (= make_operational 0)
  191.        (
  192.          (run execute_string)
  193.        )
  194.     )
  195.  
  196.     (set error 
  197.        (trap 1 4
  198.           (startup assign_name
  199.              (prompt 
  200.                 ("%s\n%s\n\n%s\n%s\n%s"
  201.                  "The following commands have been created."
  202.                  "Do you want the following commands to be added to your startup?"
  203.                  assign_string
  204.                  startup_assign_string
  205.                  execute_string
  206.                 )
  207.              )
  208.              (command 
  209.                 (cat assign_string "\n")
  210.                 (cat startup_assign_string "\n")
  211.                 (cat execute_string "\n")
  212.              )
  213.              (help "They are not required, but they just make it much easier"
  214.                    "for you later on.  Upon your approval, the "
  215.                    "installer will add the necessary commands to your s:user-startup "
  216.                    "script, which is run when your machine boots.  If you decide not "
  217.                    "to allow the installer to make these changes, you will need to "
  218.                    "make them yourself."
  219.              )
  220.          )
  221.        )
  222.     )
  223.    )
  224. )
  225.  
  226. (complete 100)
  227.  
  228. (exit (cat "Installation of " @app-name " is complete."))
  229.